//
//  LocalDetailTableCell.m
//  MiaoTu
//
//  Created by dllo on 16/9/19.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "LocalDetailTableCell.h"
#import "UIImageView+WebCache.h"
#import "ComRes.h"

@interface LocalDetailTableCell ()
@property (weak, nonatomic) IBOutlet UIImageView *picImage;
@property (weak, nonatomic) IBOutlet UILabel *resNameLabel;
@property (weak, nonatomic) IBOutlet UILabel *resGradeLabel;
@property (weak, nonatomic) IBOutlet UILabel *addressLabel;
@property (weak, nonatomic) IBOutlet UILabel *minPriceLabel;
@property (weak, nonatomic) IBOutlet UILabel *originalPriceLabel;
@property (weak, nonatomic) IBOutlet UILabel *cityNameLabel;
@property (weak, nonatomic) IBOutlet UILabel *hotelLabel;

@end

@implementation LocalDetailTableCell

- (void)setComRes:(ComRes *)comRes {
    _comRes = comRes;
    
    [_picImage sd_setImageWithURL:[NSURL URLWithString:_comRes.DefaultImageUrl] placeholderImage:[UIImage imageNamed:@"placeholderImage"]];
    _cityNameLabel.text = _comRes.CityName;
    _resNameLabel.text = _comRes.ResName;
    _resGradeLabel.text = _comRes.ResGrade;
    _addressLabel.text = _comRes.Address;
    _minPriceLabel.text = [NSString stringWithFormat:@"%zd", _comRes.MinPrice];
    _originalPriceLabel.text = [NSString stringWithFormat:@"%zd", _comRes.OriginalPrice];
}

- (void)awakeFromNib {
    // Initialization code
    [super awakeFromNib];
    [self.contentView bringSubviewToFront:_cityNameLabel];
    [self.contentView bringSubviewToFront:_hotelLabel];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
